package com.three.crm.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.three.crm.R;
import com.three.crm.bean.CompanyBean;
import com.three.crm.bean.PoundBean;

import java.util.List;

public class CompanyListAdapter extends BaseQuickAdapter<CompanyBean, BaseViewHolder> {

    public CompanyListAdapter(@Nullable List<CompanyBean> data) {
        super(R.layout.item_list_company,data);
    }

    public CompanyListAdapter() {
        super(R.layout.item_list_company);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, CompanyBean item) {
        helper.setText(R.id.tv_company,item.getTitle())
                .setText(R.id.tv_name, item.getAddress())
                .setText(R.id.tv_phone, "" + item.getPhone())
                .setText(R.id.tv_delete, item.getStatus() == 2 ? "已拉黑":"拉黑")
                .addOnClickListener(R.id.tv_detail,R.id.tv_edit,R.id.tv_delete);
    }
}
